<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
     <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
     <style>
        .radio-inline input[type=radio] {
            margin-top: 4px
        }
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">TI核销批量设置发票信息</h2>
    </div>
    <!-- 标题 -->
    <div >
    <form  class="form-inline">
     <table class="table table-bordered bud_hei" style="margin-top:0">
        <tr>
            <td style="min-width: 120px;width: 120px">有无发票<span class="colorRed">*</span>：</td>
            <td>
            <label class="radio-inline">
                  <input type="radio" name="ionse" checked id="inlineRadio1" value="1" >有发票
            </label>
             <label class="radio-inline">
                  <input type="radio" name="ionse" id="inlineRadio2" value="2">暂未开出，后补发票
            </label>
             <label class="radio-inline">
                  <input type="radio" name="ionse" id="inlineRadio3" value="0">不开发票且不补发票
            </label>
            </td>
        </tr>
        <tr>
          <td style="min-width: 120px;width: 120px">发票号：</td>
          <td><input type="text" name="" id="fano" class="form-control"><a href="javascript:;">如何查看发票？</a></td>
        </tr>
        <tr>
        <td style="min-width: 120px;width: 120px">是否增票(可抵扣)<span class="colorRed">*</span> ：</td>
          <td>
             <label class="radio-inline">
                  <input type="radio" name="ionsez" id="io1" value="1" >是(可抵扣)
            </label>
             <label class="radio-inline">
                  <input type="radio" name="ionsez" checked id="io2" value="0">否(不可抵扣)
            </label>
            <a href="javascript:;">如何查看是否增票(可抵扣)?</a>
          </td>
        </tr>
        <tr>
        <td style="min-width: 120px;width: 120px">税率<span class="colorRed">*</span>：</td>
          <td><input type="text" name="" value="0.00" id="shuilv" class="form-control">% <a href="javascript:;">如何查看税率？</a></td>
        </tr>
        <tr>
           <td style="min-width: 120px;width: 120px">支付方式<span class="colorRed">*</span>：</td>
           <td>
                <select name="" id="zfid" class="form-control">
                   {volist name="fipay" id="vo"}

						<option value='{$vo.id}'>{$vo.title}</option>
                   		
                   {/volist}
                </select>
           </td>
        </tr>
     </table>
       <div class="row text-center padding-10">
            <button class="btn btn-success" type="button" id="tijiao">确认提交</button>
            <button class="btn btn-warning" type="button" id="cancelBack">关闭返回</button>
        </div>
    </form>
    </div>
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script>
     $("#tijiao").click(function(){
     	var msg="";
     	var ckfp=$("input[name='ionse']:checked").val();
     	var isdi=$("input[name='ionsez']:checked").val();
     	//提交验证
     	if(ckfp ==1){
     		if($("#fano").val()==""){
     			msg="有发票必须填写发票号";
     		}
     	}
     	if(msg==""){
     		if(ckfp==0){
     			parent.$(".fafou").prop("checked",true);
     			parent.$(".fapiao").prop("readonly",true);
     			parent.$(".isfa").val(0);
     		}else if(ckfp==1){
                parent.$(".fafou").prop("checked",true);
                parent.$(".fapiao").prop("readonly",true);
                parent.$(".isfa").val(0);
            }
            else{
     			parent.$(".fashi").prop("checked",true);
     			parent.$(".isfa").val(1);
     			
     			parent.$(".fapiao").prop("readonly",false);
     			
     		}
     		parent.$(".fapiao").val($("#fano").val());
     		if(isdi==1){
     			parent.$(".dikoushi").prop("checked",true);
     			parent.$(".isdi").val(1);
     		}else{
     			parent.$(".dikoufou").prop("checked",true);
     			parent.$(".isdi").val(0);
     		}
     		parent.$(".shuilv").val($("#shuilv").val());
     		parent.$(".zfid").val($("#zfid").val());
     		parent.$(".shuilv").each(function(){
     			 var price=$(this).parent().prev().prev().prev().prev().children().val();
		          if(price!=""){
		            price=parseFloat(price);
		            var shuilv=parseFloat($(this).val());
		            var shuijin=(price*shuilv/100).toFixed(2);
		            var zonge=(price+parseFloat(shuijin)).toFixed(2);
		            $(this).parent().next().children().val(shuijin);
		             $(this).parent().next().next().children().val(zonge);
                     if(isdi==1)
                        $(this).parent().next().next().next().children().val(price);
                    else
                        $(this).parent().next().next().next().children().val(zonge);
		             parent.jisuanzongshu();

          }
     		})
     		parent.layer.close(parent.layer.getFrameIndex(window.name));
     	}else{
     		swal({
                            title: "错误",
                            text:  msg,
                            type: "warning"
                            });
     	}

     })
     $("#shuilv").blur(function(){
     	if(isNaN(parseFloat($(this).val()))){
     		$(this).val("0.00");
     	}else{
     		$(this).val(parseFloat($(this).val()).toFixed(2));
     	}
     })
     $("input[name='ionse']").change(function(){
     	if($(this).val()==1){
     		$("#fano").prop("readonly",false);
     	}else{
     		$("#fano").val("");
			$("#fano").prop("readonly",true);
     	}
     })
        var cancelBack = document.getElementById('cancelBack')
              cancelBack.onclick = function(){
               parent.layer.close(parent.layer.getFrameIndex(window.name));
           }
    </script>
    </body>
   
</html>